<?php
if (! defined ( 'BASEPATH' ))
	exit ( 'No direct script access allowed' );
class Common {
	/**
	 * 按照系统时间创建文件夹
	 *
	 * @param string $path 制定根目录 【必须存在】
	 */
	function createDirByCurrentDate($path) {
		$dateArray = explode ( "-", date ( "Y-m-d" ) );
		for($i = 0; $i < count ( $dateArray ); $i ++) {
			$path = $path . $dateArray [$i] . "/";
			if (! file_exists ( $path )) {
				mkdir ( $path );
			}
		}
	}
	
	/**
	 * 创建uuid
	 *
	 * @return unknown
	 */
	function uuid() {
		$better_token = md5(uniqid(mt_rand(), true));
		return $better_token;
	}
}

?>